import { LinkedList } from "./linked_list";
import { DoublyLinkedList } from "./doubly_linked_list";


const ll = new LinkedList()
ll.push('AAA')
ll.push('BBB')
ll.push('DDD')
ll.insert('CCC', 2)
console.log('ll.getElement(2)', ll.getElement(2))
console.log('ll.getIndex("CCC")', ll.getIndex('CCC'))
console.log('ll.isEmpty()', ll.isEmpty())
console.log('ll.getSize()', ll.getSize())
ll.remove('AAA')
ll.removeAt(0)
console.log('单向链表-ll', ll)


const dll = new DoublyLinkedList()
dll.push('AAA')
dll.push('BBB')
dll.push('DDD')
dll.insert('CCC', 2)
console.log('dll.getElement(2)', dll.getElement(2))
console.log('dll.getIndex("CCC")', dll.getIndex('CCC'))
console.log('dll.isEmpty()', dll.isEmpty())
console.log('dll.getSize()', dll.getSize())
dll.remove('AAA')
dll.removeAt(0)
console.log('双向链表-dll', dll)